{% init category_url = xutils.call("plugin.get_category_url_by_code", model.category) %}


{% if model.header_html != "" %}
    <!-- 自定义Header -->
    {% raw model.header_html %}
{% elif model.show_title %}
    <!-- 插件默认的header -->
    <div class="plugin-head card">
        <div class="card-title btn-line-height">
            {% if model.show_category and model.category %}
                <a class="link2" href="{{category_url}}">{{model.category_name}}</a>
                <span>/</span>
            {% end %}
            <span>{{title}}</span>
            <span class="float-right">
                {% raw model.option_html %}

                {% if _is_admin and model.show_edit and model.editable %}
                    <a class="btn" href="{{_server_home}}/code/edit?path={{fpath}}">编辑</a>
                {% end %}
                <a class="btn btn-default" href="javascript:history.back();">返回</a>
            </span>
        </div>
    </div>

    {% if description != "" or error != "" or rows > 0 %}
        <div class="card">
            {% if description != "" %}
                <pre class="col-md-12 plugin-description">{{description}}</pre>
            {% end %}

            {% if error != "" %}
                <pre class="col-md-12 error">{{error}}</pre>
            {% end %}

            {% if rows > 0 %}
                <div class="row">
                    <form method="{{method}}">
                        <!-- 输入框区域 BEGIN -->
                        {% if rows == 1 %}
                            <input type="text" class="plugin-input" name="input" value="{{input}}" placeholder="{{model.placeholder}}"/>
                        {% else %}
                            <textarea class="col-md-12 code" name="input" rows={{rows}} placeholder="{{model.placeholder}}">{{input}}</textarea>
                        {% end %}
                        <!-- 输入框区域 END -->

                        <!-- 按钮区域 BEGIN -->
                        <button>{{model.btn_text}}</button>
                        <!-- 按钮区域 END -->
                    </form>
                </div>
            {% end %}
        </div>
    {% end %}
    
{% end %}
